package com.just.fun.java8;

import java.util.concurrent.ConcurrentHashMap;

/**
 * 测试ConcurrentHashMap
 */
public class ConcurrentHashMapTest {
    public static void main(String[] args){
        ConcurrentHashMap<String,String> concurrentHashMap=new ConcurrentHashMap<>();
        concurrentHashMap.put("1","111");
        concurrentHashMap.put("2","222");
        concurrentHashMap.put("3","333");
        for(String key:concurrentHashMap.keySet()){
              if("1".equals(key)){
                  concurrentHashMap.remove(key);
              }
              if("2".equals(key)){
                  concurrentHashMap.put("2","23333333333");
              }
        }
        System.out.println(concurrentHashMap);
    }
}
